Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@foundit/motion-blur
Advanced tools
Makes your elements move with a motion blur effect. Vroom, vrooom!
Do you want to make your web animations look like they are breaking the sound barrier? Do you want to impress your users with the illusion of speed and dynamism? Do you want to add some speeeed to your pixels? Then you need more Motion Blur, the helper that makes your elements go vroom vroom!
Moving things around on a web page is easy, but making them look fast is hard. You can't just crank up the animation speed and hope for the best. That would make your elements look choppy and unnatural. What you need is some blur, some directional blur that follows the movement of your elements and makes them look like they are zooming across the screen. That's what Motion Blur does for you. It adds a touch of realism and excitement to your web animations. And the best part is, you can actually slow down your animations and they will still look like they are shooting out of a gun barrel. Enjoy the awesome effect of Motion Blur.
Motion Blur uses javascript easing algorithms to animate your elements and calculate their position on every frame (using the requestAnimationFrame method to avoid blocking the JS thread). Then, it applies a filter svg to your elements and adjusts the amount and direction of the blur according to their movement. This way, you get a smooth and realistic motion blur effect that works with any element you want. Motion Blur does not rely on CSS transition/animation or the web animation api like the microAnimation package does..
npm install @foundit/motion-blur
import { motionBlur } from '@foundit/motion-blur'
Minimum is to pass an element and in the options argument object, pass x, y in pixels to get the element movin'.
async function openDrawer() {
await motionBlur(myDrawerElement, {
duration: 800,
x: -300,
y: 0,
})
console.log('My drawer is open')
}
element
- element to move.durationMs
- defaults to 1000ms.x
- move relative to current position.y
- move relative to current position.xAbsolute
- optional absolute positioning alternative.yAbsolute
- optional absolute positioning alternative.applyToggle
easing
- many built in easings are available, see https://easings.net/useMotionBlur
- defaults to true.blurMultiplier
- defaults to 1. 1.5 makes the motion bluriness 50% more pronounced. A 10 pixel move with multiplier set to 30 will render the same amount of max blur as a 300px move with multiplier set to 1.blockMovement
- defaults to false. Motions blurs but doesn't move.docRoot
- This is were the SVG will be placed into. Defaults to document.bodyThis little utility is built in Typescript. MotionBlurOptions
, easingFactoryProduct
types are exported.
Should you feel adventurous, go take the easings algorithms for a spin on your own. The easingFactory
function is exported as well. Have fun.
Links: NPM | Github Issues | Codepen
Author: nicolas@hervy.se
0.0.5
FAQs
Makes your elements move with a motion blur effect. Vroom, vrooom!
The npm package @foundit/motion-blur receives a total of 772 weekly downloads. As such, @foundit/motion-blur popularity was classified as not popular.
We found that @foundit/motion-blur demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.